package com.miaoxun.dao;

import com.miaoxun.dao.provider.RoleMenuProvider;
import com.miaoxun.domain.entity.RoleMenu;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import com.basemapper.BasicMapper;

import java.util.List;

/**
 * 角色与菜单对应关系
 *
 * @author ruoshuisixue
 * @email ruoshuisixue@sina.com
 * @date 2017-11-17 14:38:42
 */
@Mapper
@Component
public interface RoleMenuMapper extends BasicMapper<RoleMenu> {



    @Select("select menu_id from role_menu  where role_id = #{roleId}")
    List<Long> listMenuIdByRoleId(Long roleId);

    @Delete("delete from role_menu where role_id=#{roleId}")
    void removeByRoleId(Long roleId);

    @InsertProvider(type = RoleMenuProvider.class,method="batchSave")
    void batchSave(@Param("list") List<RoleMenu> rms);
}
